package com.braisefish.jfxsupport.splashscreen;

import com.braisefish.jfxsupport.ResourceUtil;
import javafx.scene.Parent;
import javafx.scene.control.ProgressBar;
import javafx.scene.image.ImageView;
import javafx.scene.layout.VBox;

/**
 * @author 32365
 */
public abstract class StableSplashScreen implements ISplashScreen{

    @Override
    public Parent getParent() {
        final ImageView imageView = createImageView();
        final ProgressBar splashProgressBar = new ProgressBar();
        splashProgressBar.setPrefWidth(imageView.getImage().getWidth());
        final VBox vbox = new VBox();
        vbox.getChildren().addAll(imageView, splashProgressBar);
        return vbox;
    }
    public abstract ImageView createImageView();
    @Override
    public boolean visible() {
        return true;
    }
}
